# -*- coding: utf-8 -*-
# @Time    : 2018/12/19 10:51
# @Author  : yueconger
# @File    : demo.py
import pymysql
import requests
from DBUtils.PooledDB import PooledDB


class MySQLDB(object):
    def __init__(self):
        self.conPool = PooledDB(
            pymysql,
            8,
            host='182.254.134.202',
            port=3306,
            user='assess_user',
            passwd='asuser123_API',
            db='asscess_api_test',
            charset='utf8')


if __name__ == '__main__':
    db = MySQLDB()
    pool = db.conPool
    conn = pool.connection()
    cur = conn.cursor()
    sql = "select * from api_evaluation where uuid = '1fe0a434ef2e47699e2e37656d71f6bb'"
    try:
        res_db = cur.execute(sql)
    except:
        print('查询有误!')
    results = cur.fetchall()
    print(results)
